#ifndef __DRV_SPINAND_H
#define __DRV_SPINAND_H

#include "ch32v30x.h"

#define SPINOR_SPI_NUM SPI3

void SPINor_Init(void);
uint8_t SPINor_ReadSR(void);
uint16_t SPINor_ReadID(void);
void SPINor_ReadUniqueID(uint8_t *id);
void SPINor_ReadJedecID(uint8_t *id);
void SPINor_Read(u8 *pBuffer, u32 ReadAddr, u16 size);
void SPINor_Erase_Chip(void);
void SPINor_Erase_Sector(u32 Dst_Addr);
void SPINor_Write_Page(u8 *pBuffer, u32 WriteAddr, u16 size);

#endif // __DRV_SPINAND_H
